package com.b.repository;

import com.b.domain.Live;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.SearchPage;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface LiveRepository extends ElasticsearchRepository<Live, Integer> {
    List<Live> findByUserId(Integer userId);

    Live findByUserIdAndLiveStatus(Integer userId, String status);

    SearchPage<Live> findLivesByTitleLike(Pageable pageable, String title);

    SearchPage<Live> findLiveByTitleLikeAndLiveStatus(Pageable pageable, String title, String status);

    Live findByIdAndLiveStatus(Integer id, String status);
}
